<template>
  <i
    @click="changeScreen"
    class="iconfont icon-fullscreen-expand"
  ></i>
</template>

<script>
import screenfull from 'screenfull'
export default {

  methods: {
    //   改变全屏
    changeScreen () {
      if (!screenfull.isEnabled) {
        // 此时全屏不可用
        this.$message.warning('此时全屏组件不可用')
        return
      }
      // document.documentElement.requestFullscreen()  原生js调用
      //   如果可用 就可以全屏
      this.isScreenFull = true
      screenfull.toggle()
    }
  }
}
</script>

<style scoped>
i {
  font-size: 030px;
  margin-right: 20px;
  cursor: pointer;
}
</style>
